package com.mbigger.biz.message;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
/**
 * @ClassName: MqReceiver 
 * @Description: 接收MQ消息
 * @author: BenWen 
 * @date: 2018-10-26 11:55:18
 */
@Component
public class MqReceiver {
    //@RabbitListener(queuesToDeclare = @Queue("myQueue"))
    //@RabbitListener(queues = "myQueue")
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue("myQueue"),
            exchange = @Exchange("myExhange")
            ))
    public void process(String message) {
        System.err.println(message);
    }
}
